﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace CognisessCommLib
{
    public class XMLHelper
    {
        public static List<Option> GetOptions(string optionName)
        {
            int count = 0;
            XElement doc = XElement.Load(AppDomain.CurrentDomain.BaseDirectory + "bin\\OptionConstants.xml");

            var result = (from x in doc.Descendants(optionName).First().Elements()

                          select new Option
                          {
                              Value = count++,
                              Text = x.Value
                          }).ToList();

            return result;
        }
    }
}
